package operation;

import Book.BookList;

public class Exit implements IOperation{

    @Override
    public void work (BookList bookList) {
        System.out.println ("退出系统");

        int num=bookList.getUsedSize ();
        for (int i = 0; i <num ; i++) {
            bookList.setBook (i,null);
        }
        bookList.setUsedSize (0);

        //一直循环，直到用户选择退出程序
        System.exit(0);
    }
}
